﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Calculator
{
    class Fraction
    {
        private int n, d;

        public static implicit operator double(Fraction f)
        {
            return (double)f.n / f.d;
        }


        public static implicit operator int(Fraction f)
        {
            return f.n / f.d;
        }

        public static implicit operator Fraction(double d)
        {
            var temp = new Fraction();
            temp.n = (int)(d * 10000);
            temp.d = 10000;
            return temp;
        }
        public static implicit operator Fraction(int d)
        {
            var temp = new Fraction();
            temp.n = (int)(d * 10000);
            temp.d = 10000;
            return temp;
        }

    }
    static class Program
    {

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());

            //foo(1,2,3);
        }


        /// <summary>
        /// Foo Martians
        /// </summary>
        /// <param name="x">the number of Martians foo'd</param>
        /// <param name="y">the number of Zigwigs to foo with</param>
        /// <param name="z">nithing</param>
        static void foo(int x, int y, int z)
        {
            double d = new Fraction();
            Fraction f = 2.5;
            f = f * f;

            int a = f;
        }
    }
}
